from django.conf import settings
from django.urls import include, path
from django.contrib import admin

# 启用Django admin
admin.autodiscover()

urlpatterns = [
    # 管理后台
    path('admin/', admin.site.urls),
    
    # MES应用
    path('mes/', include('simple_mes.urls')),
    
    # 首页重定向到MES
    path('', include('simple_mes.urls')),
]

# 静态文件服务（仅在开发模式下）
if settings.DEBUG:
    from django.conf.urls.static import static
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) 